package com.noble.glamour.ui.agora.manager;

import android.app.Activity;
import android.content.Context;
import android.support.v4.app.FragmentActivity;
import android.text.TextUtils;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.noble.glamour.R;
import com.noble.glamour.bean.config.VideoVerifyBean;
import com.noble.glamour.module.logic.application.App;
import com.noble.glamour.module.logic.application.ModuleMgr;
import com.noble.glamour.module.logic.baseui.LoadingDialog;
import com.noble.glamour.module.logic.config.UrlParam;
import com.noble.glamour.module.logic.request.HttpResponse;
import com.noble.glamour.module.logic.request.RequestComplete;
import com.noble.glamour.module.util.UIShow;
import com.noble.glamour.ui.agora.RtcUIShow;
import com.noble.glamour.ui.agora.act.bean.Invited;
import com.noble.glamour.ui.agora.manager.RtcMessageMgr;
import com.noble.glamour.ui.agora.model.AgoraConstant;
import com.noble.glamour.ui.agora.model.EngineConfig;
import com.noble.glamour.ui.agora.util.RtcJointChannel;
import com.noble.library.log.PSP;
import com.noble.library.log.PToast;
import com.noble.library.observe.ModuleBase;
import com.noble.library.observe.MsgMgr;

import org.json.JSONObject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 音视频聊天相关管理类
 * <p>
 * Created by Su on 2017/10/28.
 */
public class RtcChatMgr implements ModuleBase {
    @Override
    public void init() {
    }

    @Override
    public void release() {
    }

    // ====================== 存储vcid  消息列表使用 ===============================
    private static final String RTC_SAVE_VCID = "VCID";   // 存储vcid到SP

    public boolean isContain(long vcID) {
        List<Long> longList = getLongList();
        if (longList.size() <= 0) {
            return false;
        }
        for (long tmp : longList) {
            if (vcID == tmp) {
                return true;
            }
        }
        return false;
    }

    public void remove(long vcID) {
        List<Long> longList = getLongList();
        if (longList.size() > 0) {
            longList.remove(vcID);
            PSP.getInstance().put(RTC_SAVE_VCID + App.uid, JSON.toJSONString(longList));
        }
    }

    private void addvcID(long vcID) {
        List<Long> longList = getLongList();
        if (longList == null) {
            longList = new ArrayList<>();
        }
        longList.add(vcID);
        PSP.getInstance().put(RTC_SAVE_VCID + App.uid, JSON.toJSONString(longList));
    }

    private List<Long> getLongList() {
        try {
            String tmpStr = PSP.getInstance().getString(RTC_SAVE_VCID + App.uid, "");
            if (!TextUtils.isEmpty(tmpStr)) {
                return JSON.parseObject(tmpStr, new TypeReference<List<Long>>() {
                });
            }
        } catch (Exception e) {
        }
        return new ArrayList<>();
    }

    // ========================================= 状态标志 ==================================
    /**
     * 是否处于群发状态
     */
    private boolean isGroupInvite = false;  // 用户是否处于群发状态

    public void setGroupInviteStatus(boolean isGroupInvite) {
        this.isGroupInvite = isGroupInvite;
    }

    public boolean getGroupInviteStatus() {
        return isGroupInvite;
    }

    /**
     * 群发邀请消息面板计时存储
     */
    private static long inviteTime = 0;

    // 处于群发邀请时获取inviteTime
    public long getInviteTime() {
        return inviteTime;
    }

    // 处于群发邀请时设置inviteTime
    public void setInviteTime(long inviteTime) {
        this.inviteTime = inviteTime;
    }


    // ========================================= 权限检测 ==================================

    /**
     * 检测发起音视频权限
     */
    private boolean checkChatAuth(Activity context, long dstUid, String channel_uid) {
//        UserDetail userDetail = ModuleMgr.getCenterMgr().getMyInfo();
//
//        // 女号不进行判断
//        if (!userDetail.isMan()) return true;
//
//        Video video = getCommonMgr().getCommonConfig().getVideo();
//        int diamondCount = userDetail.getDiamand();
//
//        // 在线配置，不需要VIP权限, 只判断钻石数量
//        boolean isTip = false;
//        switch (chatType) {
//            case AgoraConstant.RTC_CHAT_VIDEO:
//                isTip = video.isVideoCallNeedVip() && !userDetail.isVip();
//                break;
//            case AgoraConstant.RTC_CHAT_VOICE:
//                isTip = video.isAudioCallNeedVip() && !userDetail.isVip();
//                break;
//        }
//
//        // 不需要VIP权限 || 已经是VIP用户
//        if (!isTip) {
//            if (diamondCount <= 0) {
//                UIShow.showGoodsDiamondDialogAndTag(context, Constant.OPEN_FROM_CHAT_PLUGIN, dstUid, channel_uid);
//                return false;
//            }
//            return true;
//        }
//
//        // 需要进行VIP权限判断
//        if (!userDetail.isVip()) {
//            UIShow.showGoodsVipBottomDlg(context, GoodsConstant.DLG_VIP_AV_CHAT);
//            return false;
//        }
//
//        if (diamondCount <= 0) {
//            UIShow.showGoodsDiamondDialogAndTag(context, Constant.OPEN_FROM_CHAT_PLUGIN, dstUid, channel_uid);
//            return false;
//        }
        return true;
    }


    // ========================================= 普通发起音视频聊天 ==================================
    private int singleType;                     // 非默认情况值, 0:还没选择,1:自己露脸，2:自己不露脸
    private int chatType;                       // 通信类型  1为视频{@link # AgoraConstant.RTC_CHAT_VIDEO}，2为音频{@link # AgoraConstant.RTC_CHAT_VOICE}

    /**
     * 发起音视频：展示出场弹框
     *
     * @param dstUid     通信对方ID
     * @param type       通信类型  1为视频{@link # AgoraConstant.RTC_CHAT_VIDEO}，2为音频{@link # AgoraConstant.RTC_CHAT_VOICE}
     * @param singleType 非默认情况值, 0:还没选择,1:自己露脸，2:自己不露脸
     * @param isInvate   是否来自邀请他按钮，只有女号有。布局和出场方式 singleType 不同
     */
    public void inviteVAShowDlg(final Activity context, long dstUid, int type, int singleType, String channel_uid, boolean isInvate) {
        chatType = type;
        if (!checkChatAuth(context, dstUid, channel_uid)) return;

        PSP.getInstance().put("ISINVITE", false);
        boolean isMan = ModuleMgr.getCenterMgr().getMyInfo().isMan();  // 女号不弹框
        if (isMan && AgoraConstant.RTC_CHAT_VIDEO == type &&
                PSP.getInstance().getInt(ModuleMgr.getCommonMgr().getPrivateKey(AgoraConstant.APPEAR_FOREVER_TYPE), 0) == 0) {
            UIShow.showLookAtHerDlg(context, dstUid, channel_uid, isInvate);
            return;
        }
        this.singleType = singleType;
        inviteVoice(context, dstUid, channel_uid);
    }

    /**
     * 邀请对方视频聊天
     */
    public void inviteVideo(final Activity context, final long dstUid, final int singleType, final String channel_uid) {
        chatType = AgoraConstant.RTC_CHAT_VIDEO;
        if (!checkChatAuth(context, dstUid, channel_uid)) return;

        this.singleType = singleType;
        final int diamondCount = ModuleMgr.getCenterMgr().getMyInfo().getDiamand();

        executeInviteChat(context, dstUid, channel_uid);
//        reqVideoChatConfig(dstUid, new RequestComplete() {
//            @Override
//            public void onRequestComplete(HttpResponse response) {
//                if (response.isOk()) {
//                    VideoConfig setting = (VideoConfig) response.getBaseData();
//                    if (diamondCount >= setting.getVideoPrice()) {// 钻石充足
//                        executeInviteChat(context, dstUid, channel_uid);
//                        return;
//                    }
//                    PToast.showShort("您的钻石余额不足，请充值");
//                    UIShow.showGoodsDiamondDialogAndTag(context, Constant.OPEN_FROM_CHAT_PLUGIN, dstUid, channel_uid);
//                    return;
//                }
//                JSONObject jo = response.getResponseJson();
//                PToast.showShort(TextUtils.isEmpty(jo.optString("msg")) ? "数据异常" : jo.optString("msg"));
//            }
//        });
    }

    /**
     * 邀请对方音频通信
     */
    public void inviteVoice(final Activity context, long dstUid, String channel_uid) {
        chatType = AgoraConstant.RTC_CHAT_VOICE;
        if (!checkChatAuth(context, dstUid, channel_uid)) return;

        executeInviteChat(context, dstUid, channel_uid);
    }

    /**
     * 发起音视频聊天，获取聊天渠道vcId, 消息版本号msgVer
     * <p>
     * 男性走普通发起，女性走邀请流程
     */
    private void executeInviteChat(final Context context, final long dstUid, final String channel_uid) {
        if (ModuleMgr.getCenterMgr().getMyInfo().isMan()) {
            RtcMessageMgr.getInstance().release(); // 清理同步对象
            ModuleMgr.getRtcChatMgr().reqInviteChat(dstUid, new RequestComplete() {
                @Override
                public void onRequestComplete(HttpResponse response) {
                    handleInviteChat(context, response, dstUid, channel_uid);
                }
            });
            return;
        }
        girlSingleInvite((Activity) context, dstUid, chatType);
    }

    private void handleInviteChat(final Context context, HttpResponse response, final long dstUid, String channel_uid) {
        //特殊错误码: 3001 用户正在视频聊天中 3002 该用户无法视频聊天 3003 钻石余额不足
        JSONObject jo = response.getResponseJson();
        int code = jo.optInt("code");

        if (response.isOk()) {
            final Invited invited = (Invited) response.getBaseData();
            initEnginConfig(invited.getVcId(), dstUid, AgoraConstant.RTC_CHAT_INVITE, invited.getMsgVer());
            RtcUIShow.showRtcInitAct((Activity) context);
            addvcID(invited.getVcId());
            return;
        }

        if (code == AgoraConstant.RTC_USER_NOT_PAY)
            UIShow.showGoodsDiamondBottomDlg(context);
        PToast.showShort(response.getMsg());
    }

    // ====================== 女性版： 单邀，群邀音视频聊天 ===============================

    /**
     * 女性： 发起单独邀请
     */
    public void girlSingleInvite(final Activity activity, final long dstUid, final int type) {
        chatType = type;
        RtcMessageMgr.getInstance().release(); // 清理同步对象
        ModuleMgr.getRtcChatMgr().reqGirlSingleInvite(dstUid, new RequestComplete() {
            @Override
            public void onRequestComplete(HttpResponse response) {
                handleSingleInvite(activity, response, dstUid);
            }
        });
    }

    private void handleSingleInvite(final Context context, HttpResponse response, final long dstUid) {
        int price = ModuleMgr.getCenterMgr().getMyInfo().getChatInfo().getAudioPrice();
        if (chatType == AgoraConstant.RTC_CHAT_VIDEO) {
            price = ModuleMgr.getCenterMgr().getMyInfo().getChatInfo().getVideoPrice();
        }

        if (response.isOk()) {
            Invited invited = (Invited) response.getBaseData();
            addvcID(invited.getVcId());

            initGirlEnginConfig(invited.getVcId(), dstUid, AgoraConstant.RTC_CHAT_INVITE, invited.getMsgVer(),
                    AgoraConstant.RTC_CHAT_SINGLE, price, 0);
            RtcUIShow.showRtcGroupInitAct((Activity) context);
            return;
        }

        JSONObject jo = response.getResponseJson();
        int code = jo.optInt("code");
        if (code == AgoraConstant.RTC_USER_NOT_PAY)
            UIShow.showGoodsDiamondBottomDlg(context);
        PToast.showShort(response.getMsg());
    }

    /**
     * 女性版： 发起群聊邀请
     */
    public void girlGroupInvite(final Activity activity, final int type) {
        // 处于群邀状态，不处理其他群邀请求
        if (getGroupInviteStatus()) {
            PToast.showShort(App.context.getString(R.string.invite_status));
            return;
        }

        chatType = type;
        VideoVerifyBean verifyBean = ModuleMgr.getCommonMgr().getVideoVerify();
        // 如果没有开启音视频弹框，弹窗去开启
        if ((type == AgoraConstant.RTC_CHAT_VIDEO && !verifyBean.getBooleanVideochat())
                || (type == AgoraConstant.RTC_CHAT_VOICE && !verifyBean.getBooleanAudiochat())) {
            UIShow.showOpenVaDlg((FragmentActivity) activity, type);
            return;
        }
        setGroupInviteStatus(true);
        RtcMessageMgr.getInstance().release(); // 清理同步对象
        ModuleMgr.getRtcEnginMgr().reqGirlGroupInvite(type, new RequestComplete() {
            @Override
            public void onRequestComplete(HttpResponse response) {
                handleGroupInvite(response, activity);
            }
        });
    }

    private void handleGroupInvite(HttpResponse response, Activity activity) {
        int price = ModuleMgr.getCenterMgr().getMyInfo().getChatInfo().getAudioPrice();
        if (chatType == AgoraConstant.RTC_CHAT_VIDEO) {
            price = ModuleMgr.getCenterMgr().getMyInfo().getChatInfo().getVideoPrice();
        }
        JSONObject jo = response.getResponseJson();
        if (response.isOk()) {
            JSONObject resJo = jo.optJSONObject("res");
            long inviteId = resJo.optLong("invite_id");
            initGirlEnginConfig(0, 0, AgoraConstant.RTC_CHAT_INVITE, AgoraConstant.RTC_MSG_VER,
                    AgoraConstant.RTC_CHAT_GROUP, price, inviteId);
            RtcUIShow.showRtcGroupInitAct(activity);
            return;
        }
        setGroupInviteStatus(false);
        PToast.showShort(response.getMsg());
    }

    // ============================== 音视频受邀方 ===================================

    public void acceptInviteVAChat(final long inviteId, int selectVal) {
        acceptInviteVAChat(inviteId, selectVal, true, null);
    }

    /**
     * 男性：接受女性发来的群邀请求
     *
     * @param inviteId 邀请id,即为邀请流水号，接受邀请并发起视频的时候使用
     */
    public void acceptInviteVAChat(final long inviteId, int selectVal, final boolean showToast, final RequestComplete complete) {
        PSP.getInstance().put("ISINVITE", true);
        this.singleType = selectVal;
        LoadingDialog.show((FragmentActivity) App.activity, "加入中...");
        ModuleMgr.getRtcEnginMgr().reqGirlAcceptChat(inviteId, new RequestComplete() {
            @Override
            public void onRequestComplete(HttpResponse response) {
                if (complete != null) {
                    complete.onRequestComplete(response);
                }

                if (response.isOk()) {
                    MsgMgr.getInstance().delay(new Runnable() {
                        @Override
                        public void run() {
                            LoadingDialog.closeLoadingDialog();
                        }
                    }, 20000);
                } else {
                    LoadingDialog.closeLoadingDialog();
                    if (showToast)
                        PToast.showShort(TextUtils.isEmpty(response.getMsg()) ? App.getContext().getString(R.string.chat_join_fail_tips) : response.getMsg());
                }
            }
        });
    }

    /**
     * 普通： 打开被邀请时的页面
     *
     * @param vcId     通话频道ID
     * @param dstUid   对方UID
     * @param chatType 1视频，2音频
     */
    public void openInvitedActivity(Activity activity, long vcId, long dstUid, int chatType, long price) {
        singleType = 2;   // 男默认关闭摄像头
        this.chatType = chatType;
        EngineConfig config = initEnginConfig(vcId, dstUid, AgoraConstant.RTC_CHAT_BEINVITE, AgoraConstant.RTC_MSG_VER);
        config.mChatPrice = price;
        RtcUIShow.showRtcInitAct(activity);
    }

    /**
     * 直接开启聊天页
     *
     * @param vcId     通话频道ID
     * @param dstUid   对方UID
     * @param chatType 1视频，2音频
     */
    public void openInvitedDirect(Activity activity, long vcId, long dstUid, int chatType, String vc_channel_key) {
        this.chatType = chatType;
        EngineConfig config = initEnginConfig(vcId, dstUid, AgoraConstant.RTC_CHAT_BEINVITE, AgoraConstant.RTC_MSG_VER);
        config.mChannelKey = vc_channel_key;

        RtcJointChannel.getInstance().joinChannelPrepare(false);

        if (config.mChatType == AgoraConstant.RTC_CHAT_VIDEO) {
            RtcUIShow.showRtcVideoAct(activity);
            return;
        }
        RtcUIShow.showRtcVoiceAct(activity);
    }

    // ========================== 配置参数初始化 ===============================

    /**
     * 普通版：初始化引擎通信参数配置
     *
     * @param vcId       视频通道
     * @param dstUid     对方UID
     * @param inviteType 1邀请，2受邀
     * @param msgVer     程序版本号
     */
    private EngineConfig initEnginConfig(long vcId, long dstUid, int inviteType, int msgVer) {
        ModuleMgr.getRtcEnginMgr().releaseEngineConfig();
        EngineConfig config = ModuleMgr.getRtcEnginMgr().getEngineConfig();
        int foreverType = PSP.getInstance().getInt(ModuleMgr.getCommonMgr().getPrivateKey(AgoraConstant.APPEAR_FOREVER_TYPE), 0);
        config.mVcid = vcId;
        config.mChannel = String.valueOf(vcId);
        config.mOtherId = dstUid;
        config.mChatType = chatType;
        config.mInviteType = inviteType;
        config.msgVer = msgVer;
        config.mIntervalTime = ModuleMgr.getCommonMgr().getCommonConfig().getVideo().getScreenshot_interval() * 1000;
        config.mIntervalFirstTime = ModuleMgr.getCommonMgr().getCommonConfig().getVideo().getScreenshot_interval_first_minute() * 1000;
        config.mCamera = singleType == 0 ? (foreverType == 0 ? 2 : foreverType) : singleType;
        return config;
    }

    /**
     * 女性版： 初始化引擎通信参数配置
     *
     * @param girlType 单邀，群邀类型
     * @param inviteId 邀请ID
     */
    private EngineConfig initGirlEnginConfig(long vcId, long dstUid, int inviteType, int msgVer, int girlType, int chatPrice, long inviteId) {
        EngineConfig config = initEnginConfig(vcId, dstUid, inviteType, msgVer);
        config.mGirlType = girlType;
        config.mChatPrice = chatPrice;
        config.mInviteID = inviteId;
        return config;
    }

    // ---------------------------视频优化版---------------------------
    private long inviteId;

    /**
     * 音视频邀请列表接受与回拨
     *
     * @param uid       对方uid
     * @param invite_id 女方邀请id
     * @param vtype     1 视频  2 语音
     * @param price     通信价格
     */
    public void handleGirlInvite(Activity activity, long uid, long invite_id, int vtype, int price) {
        // 失效或已回应过本次邀请
        if (inviteCancel(invite_id) || this.inviteId == invite_id) {
            if (vtype == AgoraConstant.RTC_CHAT_VIDEO) {
                inviteVideo(activity, uid, AgoraConstant.APPEAR_TYPE_NO, "");
                return;
            }
            inviteVoice(activity, uid, "");
            return;
        }

        // 钻石不足
        if (ModuleMgr.getCenterMgr().getMyInfo().getDiamand() < price) {
            //充值弹框
            UIShow.showGoodsDiamondBottomDlg(activity);
        } else {
            this.inviteId = invite_id;
            int show = PSP.getInstance().getInt(ModuleMgr.getCommonMgr().getPrivateKey(AgoraConstant.APPEAR_FOREVER_TYPE), 0);
            if (vtype == AgoraConstant.RTC_CHAT_VIDEO && show == 0) {
                UIShow.showLookAtHerDlg(App.activity, uid, "", invite_id);
            } else {
                acceptInviteVAChat(invite_id, show, true, null);
            }
        }
    }

    /**
     * 首页音视频邀请列表接受与回拨
     *
     * @param uid       对方uid
     * @param invite_id 女方邀请id
     * @param vtype     1 视频  2 语音
     * @param price     通信价格
     * @param complete  群邀结果回调
     */
    public void chatFragmentInvite(Activity activity, long uid, long invite_id, int vtype, int price, RequestComplete complete) {
        // vip
        if (ModuleMgr.getCommonMgr().getCommonConfig().getVideo().isVideoCallNeedVip() // 需要vip
                && !ModuleMgr.getCenterMgr().getMyInfo().isVip()) {
            UIShow.showGoodsVipBottomDlg(activity);
            return;
        }

        // 钻石不足
        if (ModuleMgr.getCenterMgr().getMyInfo().getDiamand() < price) {
            UIShow.showGoodsDiamondBottomDlg(activity);
            return;
        }

        // 失效
        if (inviteCancel(invite_id)) {
            if (vtype == AgoraConstant.RTC_CHAT_VIDEO) {
                inviteVideo(activity, uid, AgoraConstant.APPEAR_TYPE_NO, "");
                return;
            }
            inviteVoice(activity, uid, "");
            return;
        }

        // 回应邀请
        int show = PSP.getInstance().getInt(ModuleMgr.getCommonMgr().getPrivateKey(AgoraConstant.APPEAR_FOREVER_TYPE), 0);
        if (vtype == AgoraConstant.RTC_CHAT_VIDEO && show == 0) {
            UIShow.showLookAtHerDlg(App.activity, uid, "", invite_id, complete);
        } else {
            acceptInviteVAChat(invite_id, show, false, complete);
        }
    }

    /**
     * 邀请失效
     */
    public boolean inviteCancel(long status) {
        return status == 0;
    }


    // ======================================== 音视频通信相关请求 =======================================

    /**
     * 邀请对方视频聊天
     *
     * @param tuid 对方uid
     */
    public void reqInviteChat(long tuid, RequestComplete complete) {
        Map<String, Object> postParams = new HashMap<>();
        postParams.put("vtype", chatType);
        postParams.put("tuid", tuid);
        ModuleMgr.getHttpMgr().reqPostNoCacheHttp(UrlParam.reqInviteChat, postParams, complete);
    }

    /**
     * 女性： 发起单邀
     */
    public void reqGirlSingleInvite(long tuid, RequestComplete complete) {
        HashMap<String, Object> postParams = new HashMap<>();
        postParams.put("tuid", tuid);
        postParams.put("vtype", chatType);
        ModuleMgr.getHttpMgr().reqPostNoCacheHttp(UrlParam.girlSingleInviteVa, postParams, complete);
    }

    /**
     * 接受视频聊天请求
     */
    public void reqAcceptVideoChat(long vcid, RequestComplete complete) {
        Map<String, Object> postParams = new HashMap<>();
        postParams.put("vc_id", vcid);
        ModuleMgr.getHttpMgr().reqPostNoCacheHttp(UrlParam.reqAcceptChat, postParams, complete);
    }

    /**
     * 拒绝视频聊天请求
     */
    public void reqRejectVideoChat(long vcid, RequestComplete complete) {
        Map<String, Object> postParams = new HashMap<>();
        postParams.put("vc_id", vcid);
        ModuleMgr.getHttpMgr().reqPostNoCacheHttp(UrlParam.reqRejectChat, postParams, complete);
    }

    /**
     * 挂断视频聊天请求
     */
    public void reqStopVideoChat(long vcid, RequestComplete complete) {
        Map<String, Object> postParams = new HashMap<>();
        postParams.put("vc_id", vcid);
        ModuleMgr.getHttpMgr().reqPostNoCacheHttp(UrlParam.reqStopChat, postParams, complete);
    }

    /**
     * 视频聊天中，客户端刷新视频聊天状态（轮询接口）
     */
    public void reqCheckVideoChat(long vcid, RequestComplete complete) {
        Map<String, Object> postParams = new HashMap<>();
        postParams.put("vc_id", vcid);
        ModuleMgr.getHttpMgr().reqPostNoCacheHttp(UrlParam.reqCheckChat, postParams, complete);
    }

    /**
     * 视频聊天鉴黄接口
     *
     * @param url 图片地址
     */
    public void reqCheckPornography(long vcid, String url, RequestComplete complete) {
        Map<String, Object> postParams = new HashMap<>();
        postParams.put("vc_id", vcid);
        postParams.put("img_url", url);
        ModuleMgr.getHttpMgr().reqPostNoCacheHttp(UrlParam.reqCheckPornography, postParams, complete);
    }

    /**
     * 本地超时挂断调用接口
     */
    public void reqTimeoutChat(long vcid, RequestComplete complete) {
        Map<String, Object> postParams = new HashMap<>();
        postParams.put("vc_id", vcid);
        ModuleMgr.getHttpMgr().reqPostNoCacheHttp(UrlParam.reqTimeoutChat, postParams, complete);
    }

    /**
     * 获取他人音视频开关配置
     */
    public void reqVideoChatConfig(long tuid, RequestComplete complete) {
        HashMap<String, Object> post_param = new HashMap<>();
        post_param.put("uid", tuid);
        ModuleMgr.getHttpMgr().reqPostNoCacheHttp(UrlParam.reqVideoChatConfig, post_param, complete);
    }
}
